﻿/**
 * ...
 * @author sminutoli
*/

import com.dmotiko.general.*
import mx.transitions.easing.Regular;
import mx.transitions.Tween;

class com.dmotiko.prune.LogoBtn
extends ButtonClip
{
	
	private function initClip():Void {
		super.initClip();
		this._visible = false;
		this._alpha = 0;
		this.bShowed = false;
	}
	
	public function show():Void {
		_visible = true;
		registerTween("show", new Tween( this, "_alpha", Regular.easeOut, this._alpha, 100, 0.5, true), false, true );
		
	}
	public function hide():Void {
		registerTween("hide", new Tween( this, "_alpha", Regular.easeOut, this._alpha, 0, 0.5, true), false, true );
	}
	
	private function tweenFinished( key:String, tween:Tween ):Void {
		switch ( key ) 
		{
			case "show":
			showEnd();
			break;
			
			case "hide":
			_visible = false;
			hideEnd();
			break;
			
		}
	}
	
	public function onRelease():Void {
		this.dispatchEvent( { type: BaseClipEvent.CHANGED, target: this, data: this.data, description: "setActive" } );
	}
	
}